package com.scalar.forecast.salesForecastEntry;

/**
 * User: Sujan
 * Date: Jul 13, 2005
 * Time: 7:20:20 PM
 */
public class RowData
{
    private int projId;
    private int endCustId;
    private int productId;
    private int salesPersonId;
    private int levelOrder;
    private String projName;
    private String endCustomerName;
    private String productName;
    private String salesPersonName;
    private boolean selected;
    private AutoGrowingLinkedList slotDataList;
    private int custId;
    private int baseProductId;
    private String customerName;
    private double confidenceLevel=-1;
    private String userList1Val;
    private String userList2Val;
    private String userDefined1;
    private String userDefined2;
    private String userDefined3;
    private String userDefined4;
    private int endUserId;
    private String endUserName;
    
    private  int month;
    private int quarter;
    private int year;
    private int fcQuantity = 0;
    private float fcPrice = -1;
    private int blQuantity = 0;
    private float blPrice = -1;
    private int actualQuantity = 0;
    private float actualPrice  = -1;
    private String snapshotName;
    private int snapshotmonth;
    private int snapshotyear;

	//used in ikanos forecast porting
	private boolean ported = true;
	private String carrier;
	private String remarks;

    public RowData()
    {
        projId          = -1;
        custId          = -1;
        endCustId       = -1;
        productId       = -1;
        salesPersonId   = -1;
        projName        = null;
        endCustomerName = null;
        productName     = null;
        salesPersonName = null;
        selected        = false;
        slotDataList    = new AutoGrowingLinkedList( SlotData.class );
        snapshotName    = null;
    }

    
    public int getBaseProductId() {
		return baseProductId;
	}

	public void setBaseProductId(int baseProductId) {
		this.baseProductId = baseProductId;
	}

	public int getProjId()
    {
        return projId;
    }

    public void setProjId(int projId)
    {
        this.projId = projId;
    }

    public int getEndCustId()
    {
        return endCustId;
    }

    public void setEndCustId(int endCustId)
    {
        this.endCustId = endCustId;
    }

    public int getProductId()
    {
        return productId;
    }

    public void setProductId(int productId)
    {
        this.productId = productId;
    }

    public int getSalesPersonId()
    {
        return salesPersonId;
    }

    public void setSalesPersonId(int salesPersonId)
    {
        this.salesPersonId = salesPersonId;
    }

    public String getProjName()
    {
        return projName;
    }

    public void setProjName(String projName)
    {
        this.projName = projName;
    }

    public String getEndCustomerName()
    {
        return endCustomerName;
    }

    public void setEndCustomerName(String endCustomerName)
    {
        this.endCustomerName = endCustomerName;
    }

    public String getProductName()
    {
        return productName;
    }

    public void setProductName(String productName)
    {
        this.productName = productName;
    }

    public String getSalesPersonName()
    {
        return salesPersonName;
    }

    public void setSalesPersonName(String salesPersonName)
    {
        this.salesPersonName = salesPersonName;
    }

    public int getLevelOrder()
    {
        return levelOrder;
    }

    public void setLevelOrder(int levelOrder)
    {
        this.levelOrder = levelOrder;
    }

    public AutoGrowingLinkedList getSlotDataList()
    {
        return slotDataList;
    }

    public void setSlotDataList(AutoGrowingLinkedList slotDataList)
    {
        this.slotDataList = slotDataList;
    }

    public boolean isSelected()
    {
        return selected;
    }

    public void setSelected(boolean selected)
    {
        this.selected = selected;
    }

    public int getCustId()
    {
        return custId;
    }

    public void setCustId(int custId)
    {
        this.custId = custId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public double getConfidenceLevel() {
        return confidenceLevel;
    }

    public void setConfidenceLevel(double confidenceLevel) {
        this.confidenceLevel = confidenceLevel;
    }

    public String getUserList1Val() {
        return userList1Val;
    }

    public void setUserList1Val(String userList1Val) {
        this.userList1Val = userList1Val;
    }

    public String getUserList2Val() {
        return userList2Val;
    }

    public void setUserList2Val(String userList2Val) {
        this.userList2Val = userList2Val;
    }
    public SlotData getSlotData( int month, int year )
    {
        SlotData slotData = null;
        int size = slotDataList.size();
        for ( int i=0; i < size; i++ )
        {
            slotData = (SlotData) slotDataList.get(i);
            if ( slotData != null && slotData.getMonth() == month && slotData.getYear() == year )
            {
                return slotData;
            }
        }
        return null;
    }
    public SlotData getSlotData( String key, int month, int year )
    {
        SlotData slotData = null;
        int size = slotDataList.size();
        for ( int i=0; i < size; i++ )
        {
            slotData = (SlotData) slotDataList.get(i);
            if ( slotData != null && slotData.getMonth() == month && slotData.getYear() == year && key.equalsIgnoreCase(slotData.getKey()) )
            {
                return slotData;
            }
        }
        return null;
    }
     public void addSlotData ( SlotData slotData )
    {
        if ( slotDataList == null )
        {
            slotDataList = new AutoGrowingLinkedList( SlotData.class );
        }
        slotDataList.add( slotData );
    }


    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public float getActualPrice() {
        return actualPrice;
    }

    public void setActualPrice(float actualPrice) {
        this.actualPrice = actualPrice;
    }

    public int getActualQuantity() {
        return actualQuantity;
    }

    public void setActualQuantity(int actualQuantity) {
        this.actualQuantity = actualQuantity;
    }

    public float getBlPrice() {
        return blPrice;
    }

    public void setBlPrice(float blPrice) {
        this.blPrice = blPrice;
    }

    public int getBlQuantity() {
        return blQuantity;
    }

    public void setBlQuantity(int blQuantity) {
        this.blQuantity = blQuantity;
    }

    public float getFcPrice() {
        return fcPrice;
    }

    public void setFcPrice(float fcPrice) {
        this.fcPrice = fcPrice;
    }

    public int getFcQuantity() {
        return fcQuantity;
    }

    public void setFcQuantity(int fcQuantity) {
        this.fcQuantity = fcQuantity;
    }


    public int getQuarter() {
        return quarter;
    }

    public void setQuarter(int quarter) {
        this.quarter = quarter;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }
    
    public boolean equals( RowData y) 
    { 
        if ( y.getCustId() == this.custId && y.getProductId() == this.productId && y.getSalesPersonId() == this.salesPersonId && y.getProjName() == this.projName ) 
        	return true; 
        else return false; 
    }

    public String getSnapshotName() {
        return snapshotName;
    }

    public void setSnapshotName(String snapshotName) {
        this.snapshotName = snapshotName;
    }

    public int getSnapshotmonth() {
        return snapshotmonth;
    }

    public void setSnapshotmonth(int snapshotmonth) {
        this.snapshotmonth = snapshotmonth;
    }

    public int getSnapshotyear() {
        return snapshotyear;
    }

    public void setSnapshotyear(int snapshotyear) {
        this.snapshotyear = snapshotyear;
    }


	public String getUserDefined1() {
		return userDefined1;
	}


	public void setUserDefined1(String userDefined1) {
		this.userDefined1 = userDefined1;
	}


	public String getUserDefined2() {
		return userDefined2;
	}


	public void setUserDefined2(String userDefined2) {
		this.userDefined2 = userDefined2;
	}


	public String getUserDefined3() {
		return userDefined3;
	}


	public void setUserDefined3(String userDefined3) {
		this.userDefined3 = userDefined3;
	}


	public String getUserDefined4() {
		return userDefined4;
	}


	public void setUserDefined4(String userDefined4) {
		this.userDefined4 = userDefined4;
	}


	public int getEndUserId() {
		return endUserId;
	}


	public void setEndUserId(int endUserId) {
		this.endUserId = endUserId;
	}


	public String getEndUserName() {
		return endUserName;
	}


	public void setEndUserName(String endUserName) {
		this.endUserName = endUserName;
	}

	public boolean isPorted() {
		return ported;
	}

	public void setPorted(boolean ported) {
		this.ported = ported;
	}

	public String getCarrier() {
		return carrier;
	}

	public void setCarrier(String carrier) {
		this.carrier = carrier;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
}
